package wh.呼风唤雨;

/**
 * @author: wh(1835734390 @ qq.com)
 * @date: 2022/12/21 20:15
 * @description:
 * @version:
 */
public class Solution {
    public static void main(String[] args) {
        int[] nums = {3,3,-5,99,8,7};
        int minSum = 0;
        for (int i = 0; i < nums.length; i++) {
            if (i == 0){
                minSum = nums[i]*114;
            }else {
                minSum = minSum + nums[i]*514;
            }
        }

        int newSum = minSum;
        for (int i = 0; i < nums.length; i++) {
            newSum = newSum - nums[i] * 514 + nums[i] * 114;
            if (minSum < newSum){
                minSum = newSum;
            }
        }
        System.out.println(minSum);
    }
}
